//
//  HXGiftTableViewCell.m
//  GiftSay
//
//  Created by laohu on 16/1/12.
//  Copyright © 2016年 liyinkai. All rights reserved.
//

#import "HXGiftTableViewCell.h"

@implementation HXGiftTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createView];
        
        
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.label.frame = self.bounds;
    self.selectionStyle = UITableViewCellSelectionStyleNone;
//    if (self.isSelected) {
//        self.label.textColor = [UIColor redColor];
//    }else {
//        self.label.textColor = [UIColor blackColor];
//    }
}

- (void)createView {
    self.label = [[UILabel alloc] init];
    self.label.textAlignment = NSTextAlignmentCenter;
    self.label.textColor = [UIColor blackColor];
    //不要在初始化方法里赋值
    self.label.font = [UIFont systemFontOfSize:12 *SCREEN_WIDTH];
    [self addSubview:_label];
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

-(void)setIfyes:(BOOL)ifyes {
    _ifyes = ifyes;
    if (ifyes == YES) {
        self.label.textColor = [UIColor redColor];
    } else {
        if ([[NSUserDefaults standardUserDefaults] boolForKey:@"NightMode"] == YES) {
            self.label.textColor = [UIColor whiteColor];
        } else {
            self.label.textColor = [UIColor blackColor];
        }
        
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
